package com.davfx.httpnio;

import java.io.IOException;

final class ListenConnectionHandler implements ConnectionHandler {
	
	private final HttpListenFactory factory;
	
	public ListenConnectionHandler(HttpListenFactory factory) {
		this.factory = factory;
	}
	
	@Override
	public void handle(Connection connection) {
		connection.read(new HttpRequestReader(factory, connection));
	}
	
	@Override
	public void failed(IOException e) {
		factory.failed(e);
	}
}
